<!-- sunsblog.net CMS pocetok.inc (c)2004 Gjokica Zafirovski -->
<table>
<?
if ($a == 'delete') {
$sqld = "select * from $tbl_lokacija where id='$l_id'";
//die($sqld);
$resd = mysql_query ($sqld)
	or die("Try again sunser delete!");
$rowd = mysql_fetch_array ($resd);
echo '<tr>';
echo '<td colspan="3">';
echo '<form name="izbrisilokacija"  action="izbrisilokacija.php" method="POST" enctype="multipart/form-data"> ';
echo '<input name="l_id" type="hidden" value="'.$l_id.'">';
echo 'Избриши локација:<br />';
echo 'Име: '.$rowd["ime"];
echo '<br /><input name="submit" type="submit" value="submit"><br />';
echo '</form>';
echo '</td>';
echo '</tr>';
exit;
}
if ($a == 'edit') {
$sqle = "select * from $tbl_lokacija where id='".$l_id."'";
$rese = mysql_query ($sqle)
	or die("Try again sunser edit!");
$rowe = mysql_fetch_array ($rese);
echo '<tr>';
echo '<td colspan="3">';
echo '<form name="izmenilokacija"  action="izmenilokacija.php" method="POST" enctype="multipart/form-data"> ';
echo '<input name="l_id" type="hidden" value="'.$l_id.'">';
echo 'Измени локација:<br />';
echo 'Име:<br /><input name="ime" type="text" size="20" value="'.$rowe["ime"].'"><br />';
echo 'Слика:<br /><input name="slika" type="file" size="20" value="'.$rowe["slika"].'"><br />';
echo 'Вовед:<br /><textarea name="voved" type="text" cols="50" rows="5" >';
echo $rowe['voved'];
echo '</textarea><br />';
echo '<input name="submit" type="submit" value="submit"><br />';
echo '</form>';
echo '</td>';
echo '</tr>';
exit;
}
$sql = "select * from $tbl_lokacija order by id";
$res = mysql_query ($sql)
	or die("Try again sunser data!");
while ($row = mysql_fetch_array ($res)) {
echo "<tr style='background-color:#F0F0F0' class='cetivo'>";
echo "<td valign='top'>";
echo $row['id'];
echo "</td>";
echo "<td valign='top'>";
echo $row['ime'];
echo "</td>";
echo "<td valign='top'>";
echo "<a href='../images/".$row['slika']."' target='_blank'>slika</a>";
echo "</td>";
echo "<td valign='top'>";
echo $row['voved'];
echo "</td>";
echo "<td valign='top'>";
echo "<a href='".$PHP_SELF."?a=edit&l_id=".$row['id']."'>Измени</a>";
echo "</td>";
echo "<td valign='top'>";
echo "<a href='".$PHP_SELF."?a=delete&l_id=".$row['id']."'>Избриши</a>";
echo "</td>";
echo "</tr>" ;
}
?>
<tr>
<td colspan="3" class="cetivo">
<form name="novalokacija"  action="novalokacija.php" method="POST" enctype="multipart/form-data">
Нова локација:<br />
Име:<br /><input name="ime" type="text" size="20" ><br />
Слика:<br /><input name="slika" type="file" size="20" ><br />
Вовед:<br /><textarea name="voved" type="text" cols="50" rows="5" >
</textarea><br />
<input name="submit" type="submit" value="submit"><br />
</form>
</td>
</tr>
</table>